home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / ExprLong.man < prev    next >
Encoding:
Text File  |  1991-10-10  |  6.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. Tcl_ExprLong          C Library Procedures           Tcl_ExprLong
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBool, Tcl_ExprString -
  12.      evaluate an expression
  13.  
  14. SSYYNNOOPPSSIISS
  15.      ##iinncclluuddee <<ttccll..hh>>
  16.  
  17.      int                                                           |
  18.      TTccll__EExxpprrLLoonngg(_i_n_t_e_r_p, _s_t_r_i_n_g, _l_o_n_g_P_t_r)                         |
  19.  
  20.      int                                                           |
  21.      TTccll__EExxpprrDDoouubbllee(_i_n_t_e_r_p, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r)                     |
  22.  
  23.      int                                                           |
  24.      TTccll__EExxpprrBBoooolleeaann(_i_n_t_e_r_p, _s_t_r_i_n_g, _b_o_o_l_e_a_n_P_t_r)                   |
  25.  
  26.      int                                                           |
  27.      TTccll__EExxpprrSSttrriinngg(_i_n_t_e_r_p, _s_t_r_i_n_g)                                |
  28.  
  29. AARRGGUUMMEENNTTSS                                                          |
  30.      Tcl_Interp   *_i_n_t_e_r_p   (in)                                        ||
  31.                                       Interpreter in whose con-    |
  32.                                       text to evaluate _s_t_r_i_n_g.     |
  33.  
  34.      char         *_s_t_r_i_n_g   (in)                                        ||
  35.                                       Expression to be evaluated.  |
  36.  
  37.      long         *_l_o_n_g_P_t_r  (out)                                       ||
  38.                                       Pointer to location in       |
  39.                                       which to store the integer   |
  40.                                       value of the expression.     |
  41.  
  42.      int          *_d_o_u_b_l_e_P_t_r(out)                                       ||
  43.                                       Pointer to location in       |
  44.                                       which to store the           |
  45.                                       floating-point value of the  |
  46.                                       expression.                  |
  47.  
  48.      int          *_b_o_o_l_e_a_n_P_t_r(out)                                      ||
  49.                                       Pointer to location in       |
  50.                                       which to store the 0/1       |
  51.                                       boolean value of the         |
  52.                                       expression.                  |
  53. _________________________________________________________________  |
  54.  
  55.  
  56. DDEESSCCRRIIPPTTIIOONN                                                        |
  57.      These four procedures all evaluate a string expression,       |
  58.      returning the result in one of four different forms.  The     |
  59.      expression is given by the _s_t_r_i_n_g argument, and it can have   |
  60.  
  61.  
  62.  
  63. Sprite v1.0                                                     1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Tcl_ExprLong          C Library Procedures           Tcl_ExprLong
  71.  
  72.  
  73.  
  74.      any of the forms accepted by the eexxpprr command.  The _i_n_t_e_r_p    |
  75.      argument refers to an interpreter used to evaluate the        |
  76.      expression (e.g. for variables and nested Tcl commands) and   |
  77.      to return error information.  _I_n_t_e_r_p->_r_e_s_u_l_t is assumed to    |
  78.      be initialized in the standard fashion when any of the pro-   |
  79.      cedures are invoked.                                          |
  80.  
  81.      For all of these procedures the return value is a standard    |
  82.      Tcl result:  TTCCLL__OOKK means the expression was succesfully      |
  83.      evaluated, and TTCCLL__EERRRROORR means that an error occurred while   |
  84.      evaluating the expression.  If TTCCLL__EERRRROORR is returned then     |
  85.      _i_n_t_e_r_p->_r_e_s_u_l_t will hold a message describing the error.  If  |
  86.      an error occurs while executing a Tcl command embedded in     |
  87.      _s_t_r_i_n_g, then that error will be returned.                     |
  88.  
  89.      If the expression is successfully evaluated, then its value   |
  90.      will be returned in one of four forms, depending on which     |
  91.      procedure is invoked.  TTccll__EExxpprrLLoonngg stores an integer value   |
  92.      at *_l_o_n_g_P_t_r.  If the expression's actual value was a          |
  93.      floating-point number, then it is truncated to an integer.    |
  94.      If the expression's actual value was a non-numeric string     |
  95.      then an error is returned.                                    |
  96.  
  97.      TTccll__EExxpprrDDoouubbllee stores a floating-point value at *_d_o_u_b_l_e_P_t_r.   |
  98.      If the expression's actual value was an integer, it is con-   |
  99.      verted to floating-point.  If the expression's actual value   |
  100.      was a non-numeric string then an error is returned.           |
  101.  
  102.      TTccll__EExxpprrBBoooolleeaann stores a 0/1 integer value at *_b_o_o_l_e_a_n_P_t_r.    |
  103.      If the expression's actual value was an integer or            |
  104.      floating-point number, then TTccll__EExxpprrBBoooolleeaann stores 0 at       |
  105.      *_b_o_o_l_e_a_n_P_t_r if the value was zero and 1 otherwise.  If the    |
  106.      expression's actual value was a non-numeric string then an    |
  107.      error is returned.                                            |
  108.  
  109.      TTccll__EExxpprrSSttrriinngg returns the value of the expression as a       |
  110.      string stored in _i_n_t_e_r_p->_r_e_s_u_l_t.  If the expression's actual  |
  111.      value was an integer or floating-point number, then           |
  112.      TTccll__EExxpprrSSttrriinngg converts it to string (using sspprriinnttff with a    |
  113.      ``%d'' or ``%g'' converter).                                  |
  114.  
  115.  
  116. KKEEYYWWOORRDDSS                                                           |
  117.      boolean, double, evaluate, expression, integer, string
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0                                                     2
  130.  
  131.  
  132.  
  133.